package com.mtons.mblog.modules.repository;

import com.mtons.mblog.modules.entity.AnswerFavorite;
import com.mtons.mblog.modules.entity.Favorite;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

public interface AnswerFavoriteRepository extends JpaRepository<AnswerFavorite, Long>, JpaSpecificationExecutor<AnswerFavorite> {
    Page<AnswerFavorite> findAllByUserId(Pageable pageable, long userId);

    AnswerFavorite findByUserIdAndAnswerId(long userId, long answerId);

    int deleteByAnswerId(long answerId);
}
